<template>
  <view class="dfb-base-page">
    <u-navbar
      back-text=""
      :title="title"
      title-color="#000"
      title-bold
      :border-bottom="false"
      z-index="89"
      ref="navbarRef"
    ></u-navbar>
    <scroll-view
      class="dfb-base-page-content"
      style="contentStyle"
      :overflow-y="overflow - y"
    >
      <slot></slot>
    </scroll-view>
  </view>
</template>
<script setup>
import { onMounted, ref } from "vue";

const props = defineProps({
  title: {
    type: String,
    default: "",
  },
  overflowY: {
    type: String,
    default: true,
  },
});

const navbarRef = ref(null);
const contentStyle = ref({});

onMounted(() => {
  const navbarHeight = navbarRef.value?.navbarHeight || 44;
  contentStyle.value = {
    height: `calc(100vh - ${navbarHeight}px)`,
  };
});
</script>
